<?php
namespace Home\Controller;
use Think\Controller;
class TeamController extends BaseController {

   
 

       public function   invite_friends()
    { 
        $key=I('key');

        if($key&&$key!=""){
           
            $map['mobile']=array('like', "%".$key."%");
            
        }

      $map['invite_id']=session('user.id');
      $invite_users=M('user')->where($map)->select(); //获取直属团队
       $jb=M('jbset')->find();
       foreach ($invite_users as $key => $value) {
         $invite_users[$key]['status']= $jb['jb'.$value['status']];
       }
        
        $this->assign('team',$invite_users)->assign("team_nav",1);
       $this->display();
    }


      public function my_lower()
    { 

      $userid=session('user.id');
      $self_user=M('user')->find($userid);
      $map['status']=$self_user['status']>1?$self_user['status']-1:$self_user['status'];

       $map['invite_id']=session('user.id');
      $invite_users=M('user')->where($map)->select(); //获取直属团队

      $this->assign('team',$invite_users);
      $this->display();
    }


     public function beyond()
    { 
     /* $map['user_id']=session('user.id');
      $lists=M('beyond_records')->where($map)->select;*/
       // $cond['beyond_sj_id']=array('NEQ','NULL');
       $cond['beyond_sj_id']=session('user.id');
       //$cond['id']=session('user.id');
             $lists=M('user')->where($cond)->select();
      $this->assign('team',$lists);
      $this->display();
    }
    //展开式家族图谱
    public function tree()
    {
      $this->display();
    }



}
